package cn.com.nong.controller;

import cn.com.nong.dao.IChatService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/chat")
public class ChatController {
    @Autowired
    IChatService chatService;
    //获取用户列表。
    @GetMapping(value = "/userList")
    @ApiOperation(value = "查询用户列表")
    public @ResponseBody
    Map<String,Object>
    findAllGoods(){
        Map<String,Object> map = new HashMap<>();
        List<Map<String, Object>> list =  chatService.getChatUserList();
        map.put("result",true);
        map.put("record",list);
        return map;
    }
}
